
<template>
	<view class="">
	<view class="custom-navbar">
	  <view class="title" @click="goback"><u-icon name="arrow-left" color="white" size="50rpx"></u-icon></view>
	  <view class="com-contain" style="background-color: rgba(255, 255, 255, 0); color: #ffffff; margin-top: 40rpx;" >
	  	<view class="com-avatar">
	  		<image :src="mes.cloge ? mes.cloge : 'http://xgr.oss-cn-hangzhou.aliyuncs.com/icon/images/default-avatar.png'" mode="" style="width: 100%; height: 100%;"></image>
	  	</view>
	  	<view class="com-containtxt" style="width: 100%;">
	  		<view class="tptxt"><text>{{mes.cname}}</text><view v-if="rz" class="aut">认证</view></view>
	  		<text class="bmtxt" style="color: #ffffff;">{{mes.cnature?mes.cnature:''}} {{mes.cindustry? '|' : ''}} {{mes.cindustry?mes.cindustry:''}} {{mes.remark1? '|' : ''}} {{mes.remark1?mes.remark1:''}}</text>
	  	</view>
	  </view>
	</view>
	
	<view class="bar">
		<u-tabs :list="menulist" @click="click"  scrollable='false'lineWidth = '25' lineHeight = '4' :current="tabstype"></u-tabs>
		<u-divider></u-divider>
	</view>
	<view class="contain" v-if="tabstype==0">
		<view class="" v-if="mes.cdescription">
			<text style="font-size: 32rpx; font-weight: 500;">企业简介</text>
			<br />
			<text style="margin-top: 30rpx;display: block;font-size: 29rpx">{{mes.cdescription}}</text>
		</view>
		<view v-if="entpiclist.length>0" style="width: 100%;">
			<text style="font-size: 32rpx; font-weight: 800; margin-top: 50rpx; display: block;">企业风采</text>
			<br />
			<u-album :urls="entpiclist" maxCount="4" rowCount="4" multiple-size="150rpx"></u-album>
		</view>
		<view class="" v-if="mes.caddr">
			<text style="font-size: 32rpx; font-weight: 500;margin-top: 50rpx;display: block;">企业地址</text>
			<br />
			<text style="margin-top: 30rpx;display: block;font-size: 29rpx">{{mes.caddr}}</text>
		</view>
	</view>
	<view class="contain2" v-if="tabstype==1">
		<block v-if="datalist && datalist.length > 0">
			
			<scroll-view scroll-y="true" class="scroll-Y" :show-scrollbar="false">
				<JobItem v-for="(item,index) in datalist" :key="index" :data="item"
					@jobItemClick="jobItemClick"></JobItem>
			</scroll-view>
			
		</block>
		
		<view v-else class="empty-img" style="display: flex;flex-direction: column; align-items: center;justify-content: center;margin-top: 200rpx;">
			<image src="http://xgr.oss-cn-hangzhou.aliyuncs.com/icon/images/icon50.png" style="width: 400rpx; height: 300rpx;margin-bottom: 50rpx;"></image>
			<label>暂无内容</label>
		</view>
	</view>
	<!-- <view class="empty-img" v-else style="margin: 100rpx auto;display: flex; flex-direction: column; width: 100%;align-items: center;">
		
			<image src="http://xgr.oss-cn-hangzhou.aliyuncs.com/icon/images/icon50.png" style="width: 500rpx;height: 400rpx;"></image>
			<label>暂无内容</label>
		
	</view> -->
	<view class="" style="height: 15vh;">
		
	</view>
	</view>
	
	
</template>

<script>
	//已注册企业详情
	import Index from "@/common/index-model.js"	
	import fun from '@/common/publicFun.js'
	let index = new Index()
	let that = null
	export default {
		data() {
			return {
				rz:true,
				tabstype:0,
				mes:'',
				datalist:[],
				menulist:[
					{name:'企业信息'},
					{name:'在招岗位'},
					],
				entpiclist:[],
			}
		},
		onLoad(e) {
			 
			this.mes = JSON.parse(e.index)
			console.log(e.index,e.istg,e.bartype)
			if(e.bartype){	
				this.tabstype = e.bartype
			}
			
			if(e.istg == 1){
				this.menulist = [
					{name:'企业信息'}
					]
			}else if(e.istg == 2){
				this.rz = false
				this.getmqcompany()
			}else{
				this.menulist = [
					{name:'企业信息'}
					]
			}
			this.getentpiclist()
			console.log('传过来的数据',this.mes)
		},
		methods: {
			jobItemClick(data) {
				uni.navigateTo({
					url: "/pagesB/jobinfo/jobLeavetwoInfo?cardID=" + data.data.id
				})
				uni.setStorage({
					key: 'cardID',
					data: data.data.id,
					success: () => {
						console.log('存入成功')
					}
				})
			},
			click(item) {
			    console.log('item信息', item);
				this.tabstype = item.index
			},
			goback(){
				uni.navigateBack()
			},
			
			
			getmqcompany(){
				console.log("名企")
				index.getPublicUserMember({
					pageNo:0,
					pageeSize:10,
					enterpriseId:this.mes.id,
				},'client/recuitjob/jobListByEnterpriseId','get',res=>{
					if(res.data.code == 200 && res.data.success){
						console.log("请求工作数据->",res.data.result.records) 
						if(this.datalist.length != res.data.result.records.length){
							this.ps += 10
						}else{
							this.isonReachBottom = false
						}
						this.datalist = res.data.result.records
						uni.stopPullDownRefresh();
					}else{
						console.log("请求失败") 
						uni.stopPullDownRefresh();
					}
				})
			},
			getentpiclist(){
				let url = '/etappearance/list/'+this.mes.id
				console.log(url)
				index.getPublicUserMember({},'/etappearance/list/'+this.mes.id,'get',res=>{
					if(res.data.code == 200 && res.data.success){
						console.log("请求图片数据->",res) 
						this.entpiclist = res.data.result.map(item => item.url);
					}else{
						console.log("请求失败",res) 
			
					}
				})
			}
		}
	}
</script>

<style scoped>
	@import url(../compy/index.css);
.custom-navbar{
	height: 27vh;
	width: 100%;
	background-image: url(https://xgr.oss-cn-hangzhou.aliyuncs.com/entlogo/WechatIMG1468.jpg);
	background-size: 100% 100%;
}
.title{
	padding-top: 100rpx;
	margin-left: 40rpx;
}
.bar{
	width: 100%;
	height: 85rpx;
	background-color: #ffffff;
	margin-top: -80rpx;
	border-radius: 34rpx 34rpx 0rpx 0rpx;
	padding: 0 40rpx;
	box-sizing: border-box;
}
.contain{
	margin-top: 10rpx;
	padding: 50rpx;
	box-sizing: border-box;
}
.contain2{
	margin-top: 10rpx;
	padding: 0rpx;
	box-sizing: border-box;
}
</style>
